home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PRINTER / PROHP.ARJ / DHMI.PRG < prev    next >
Text File  |  1992-06-23  |  3KB  |  77 lines

  1. /*
  2.   ┌─────────────────────────────────────────────────────────────────────────┐
  3.   │                                                                         │
  4.   │    Program : HMI.PRG                                                    │
  5.   │                                                                         │
  6.   │    Purpose : demonstrate the use of HP_hmi().                           │
  7.   │                                                                         │
  8.   │   Author  : Copyright (C) 1992, I.L.A.,Inc. All Rights reserved.        │
  9.   │                                                                         │
  10.   │   Comments: This source code may be distributed and used freely         │
  11.   │             provided that the copyright notice is not removed.          │
  12.   │                                                                         │
  13.   └─────────────────────────────────────────────────────────────────────────┘
  14.  
  15. */
  16. #include "prohp.ch"
  17.  
  18. proc main()
  19. Local cNumLine:="12345678901234567890123456789012345678901234567890"
  20. Local i, nTableW := 5, cL1,cL2,nHmi
  21. /*
  22.         hmi sould be set to n / 120 inch.
  23. */
  24. set2print("dhmi.hpc")
  25. HP_init()
  26. qout()
  27. HP_rline(0.01,nTableW,GFILLBLACK)
  28.  
  29. HP_cols(16)     // 16 cols per inch, this function change the HMI setting.
  30.  
  31. for i:=1 to 81
  32.     HP_savecsr()    // save cursor
  33.    if i%16=1
  34.       HP_rline(3,0.003,GFILLBLACK)  // draw line at current csr pos
  35.    else
  36.       HP_rline(3,0.01,GFILLGRAY,20)  // draw line at current csr pos
  37.    endif
  38.      HP_restcsr()    // restore curs pos
  39.    QQOUT(" ")      // advance the cursor one space/column
  40. next
  41. qout()
  42. HP_pitch(10)        // 10 cpi
  43. qout("This line is in 10 CPI ")
  44. qout(cNumLine)
  45. qout()
  46. HP_hmi(10)        // 12 cols per inch
  47. qout("This text forced to 12 CPI using HP_hmi()")
  48. qout(cNumLine)
  49. qout()
  50.  HP_pitch(16)        // 16 cpi
  51. qout("This line is in 16.66 CPI ")
  52. qout(cNumLine)
  53. qout()
  54.  HP_hmi(6)        // 20 cols per inch
  55. qout("This text forced to 20 CPI using HP_hmi()")
  56. qout(cNumLine)
  57. qout()
  58. cL1:="* Remember ! HMI has the above effect on fixed spacing fonts."
  59. cL2:="with Proportional spacing fonts HMI affect only the space character."
  60.  
  61.  HP_pitch(10)    // courier 10
  62. nHmi := nTableW * 120 / len(cL1)       // to fit cL1 in nTableW
  63.  HP_hmi(nHmi)    // set HMI
  64. qout(cL1)       // print cL1
  65. // qout("Str Len :",len(cl1)," Size:",HPstsize(cL1),["])
  66.  
  67.  HP_pitch(16)    // now use courier 16
  68. nHmi := nTableW * 120 / len(cL2)         // fit this line also
  69.  HP_hmi(nHmi)    // set HMI
  70. qout(cL2)        // print cL2
  71. // qout("Str Len :",len(cL2)," Size:",HPstsize(cL2),["])
  72.  
  73.  HP_reset()
  74. set2screen()
  75. return
  76.  
  77.